<?php
XJConfLoader::load('converters.factories.ValueConverterFactory',
                   'converters.PrimitiveValueConverter');

class PrimitiveValueConverterFactory implements ValueConverterFactory {

    private $primitives = array (
                            'int', 'integer', 'double', 'float', 'bool', 'boolean', 'string'
                          );

    public function isResponsible(Definition $def) {
        return in_array($def->getType(), $this->primitives);
    }

    public function createValueConverter(Definition $def) {
        $converter = new PrimitiveValueConverter($def->getType());
        return $converter;
    }
}
?>